+2005-04-04 Matthias Clasen <mclasen@redhat.com>
+
+ Allow completion popups to be wider than the entry. (#131916,
+ Ross Burton)
+
+ * gtk/gtkentrycompletion.[hc]: Add a boolean popup-set-width property.
+
+ * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
+ Don't force the popup to have the same width as the entry if
+ popup-set-width is FALSE.
+
+ * gtk/gtk.symbols: Add new functions.
+
2005-04-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel):
+2005-04-04 Matthias Clasen <mclasen@redhat.com>
+
+ Allow completion popups to be wider than the entry. (#131916,
+ Ross Burton)
+
+ * gtk/gtkentrycompletion.[hc]: Add a boolean popup-set-width property.
+
+ * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
+ Don't force the popup to have the same width as the entry if
+ popup-set-width is FALSE.
+
+ * gtk/gtk.symbols: Add new functions.
+
2005-04-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel):
+2005-04-04 Matthias Clasen <mclasen@redhat.com>
+
+ Allow completion popups to be wider than the entry. (#131916,
+ Ross Burton)
+
+ * gtk/gtkentrycompletion.[hc]: Add a boolean popup-set-width property.
+
+ * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
+ Don't force the popup to have the same width as the entry if
+ popup-set-width is FALSE.
+
+ * gtk/gtk.symbols: Add new functions.
+
2005-04-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel):
+2005-04-04 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtk-sections.txt: Add new functions.
+
2005-04-01 Matthias Clasen <mclasen@redhat.com>
* gtk/tmpl/gtkselection.sgml: Move docs inline.
gtk_entry_completion_get_inline_completion
gtk_entry_completion_set_popup_completion
gtk_entry_completion_get_popup_completion
+gtk_entry_completion_set_popup_set_width
+gtk_entry_completion_get_popup_set_width
<SUBSECTION Standard>
GTK_TYPE_ENTRY_COMPLETION
GTK_ENTRY_COMPLETION
gtk_entry_completion_get_minimum_key_length
gtk_entry_completion_get_model
gtk_entry_completion_get_popup_completion
+gtk_entry_completion_get_popup_set_width
gtk_entry_completion_get_text_column
gtk_entry_completion_get_type G_GNUC_CONST
gtk_entry_completion_insert_action_markup
gtk_entry_completion_set_minimum_key_length
gtk_entry_completion_set_model
gtk_entry_completion_set_popup_completion
+gtk_entry_completion_set_popup_set_width
gtk_entry_completion_set_text_column
#endif
#endif
#if IN_FILE(__GTK_ICON_VIEW_C__)
gtk_icon_view_get_column_spacing
gtk_icon_view_get_columns
+gtk_icon_view_set_cursor
+gtk_icon_view_get_cursor
gtk_icon_view_get_item_width
gtk_icon_view_get_margin
gtk_icon_view_get_markup_column
gtk_icon_view_get_model
gtk_icon_view_get_orientation
gtk_icon_view_get_path_at_pos
+gtk_icon_view_get_item_at_pos
gtk_icon_view_get_pixbuf_column
gtk_icon_view_get_row_spacing
gtk_icon_view_get_selected_items
PROP_MINIMUM_KEY_LENGTH,
PROP_TEXT_COLUMN,
PROP_INLINE_COMPLETION,
- PROP_POPUP_COMPLETION
+ PROP_POPUP_COMPLETION,
+ PROP_POPUP_SET_WIDTH
};
#define GTK_ENTRY_COMPLETION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionPrivate))
TRUE,
GTK_PARAM_READWRITE));
+ /**
+ * GtkEntryCompletion:popup-set-width:
+ *
+ * Determines whether the completions popup window will be
+ * resized to the width of the entry.
+ *
+ * Since: 2.8
+ */
+ g_object_class_install_property (object_class,
+ PROP_POPUP_SET_WIDTH,
+ g_param_spec_boolean ("popup-set-width",
+ P_("Popup set width"),
+ P_("If TRUE, the popup window will have the same size as the entry"),
+ TRUE,
+ GTK_PARAM_READWRITE));
+
g_type_class_add_private (object_class, sizeof (GtkEntryCompletionPrivate));
}
priv->has_completion = FALSE;
priv->inline_completion = FALSE;
priv->popup_completion = TRUE;
+ priv->popup_set_width = TRUE;
/* completions */
priv->filter_model = NULL;
priv->popup_completion = g_value_get_boolean (value);
break;
+ case PROP_POPUP_SET_WIDTH:
+ priv->popup_set_width = g_value_get_boolean (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
g_value_set_boolean (value, gtk_entry_completion_get_popup_completion (completion));
break;
+ case PROP_POPUP_SET_WIDTH:
+ g_value_set_boolean (value, gtk_entry_completion_get_popup_set_width (completion));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
GTK_WIDGET (completion->priv->entry)->window);
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
- width = MIN (completion->priv->entry->allocation.width, monitor.width) - 2 * x_border;
+ if (completion->priv->popup_set_width)
+ width = MIN (completion->priv->entry->allocation.width, monitor.width) - 2 * x_border;
+ else
+ width = -1;
+
+ gtk_tree_view_columns_autosize (completion->priv->tree_view);
gtk_widget_set_size_request (completion->priv->tree_view, width, items * height);
/* default on no match */
return completion->priv->popup_completion;
}
+/**
+ * gtk_entry_completion_set_popup_set_width:
+ * @completion: a #GtkEntryCompletion
+ * @popup_set_width: %TRUE to make the width of the popup the same as the entry
+ *
+ * Sets whether the completion popup window will be resized to be the same
+ * width as the entry.
+ *
+ * Since: 2.8
+ */
+void
+gtk_entry_completion_set_popup_set_width (GtkEntryCompletion *completion,
+ gboolean popup_set_width)
+{
+ g_return_if_fail (GTK_IS_ENTRY_COMPLETION (completion));
+
+ popup_set_width = popup_set_width != FALSE;
+
+ if (completion->priv->popup_set_width != popup_set_width)
+ {
+ completion->priv->popup_set_width = popup_set_width;
+
+ g_object_notify (G_OBJECT (completion), "popup-set-width");
+ }
+}
+
+/**
+ * gtk_entry_completion_get_popup_set_width:
+ * @completion: a #GtkEntryCompletion
+ *
+ * Returns whether the completion popup window will be resized to the
+ * width of the entry.
+ *
+ * Return value: %TRUE if the popup window will be resized to the width of
+ * the entry
+ *
+ * Since: 2.8
+ **/
+gboolean
+gtk_entry_completion_get_popup_set_width (GtkEntryCompletion *completion)
+{
+ g_return_val_if_fail (GTK_IS_ENTRY_COMPLETION (completion), TRUE);
+
+ return completion->priv->popup_set_width;
+}
+
+
#define __GTK_ENTRY_COMPLETION_C__
#include "gtkaliasdef.c"
void gtk_entry_completion_set_popup_completion (GtkEntryCompletion *completion,
gboolean popup_completion);
gboolean gtk_entry_completion_get_popup_completion (GtkEntryCompletion *completion);
+void gtk_entry_completion_set_popup_set_width (GtkEntryCompletion *completion,
+ gboolean popup_set_width);
+gboolean gtk_entry_completion_get_popup_set_width (GtkEntryCompletion *completion);
+
/* convenience */
void gtk_entry_completion_set_text_column (GtkEntryCompletion *completion,